#ifndef WORDWRAPTEXTBOX_H_
#define WORDWRAPTEXTBOX_H_

#include "objectdraw/objectdraw.h"
#include "../../Libs/ArrayList.h"
#include "Libs/MyFunctions.h"

class WrappedLine
{
	private:
		string message;
		ArrayList<string> wrappedLines;
		int colsize;
		
	public:
		WrappedLine(){}
		WrappedLine(int _colsize);
		WrappedLine(string initText, int _colsize);
		
		string getLine(int linenum);
		int getWrappedLineCount();
		string getText();
};

class WrappedLineSet
{
	private:
		int colsize;
		ArrayList<WrappedLine> wrappedLines;
		ArrayList<string> message;
		
	public:
		WrappedLineSet(){}
		WrappedLineSet(int _colsize);
		WrappedLineSet(string initText, int _colsize);
		
		void updateText();
		void setText(string text);
		
		int getLineCount();
		string getLine(int linenum);
		string getText();
};

class WordWrapTextBox
{
	private:
		DrawingCanvas *canvas;
		
		WrappedLineSet text;
		ArrayList<Text *> vLines;
		
		int topline;
		int charwidth,charheight;
		int colsize,rowsize;
		
		int pageX,pageY;
	public:
		WordWrapTextBox(){}
		WordWrapTextBox(int _x, int _y,int _colsize,int _rowsize, DrawingCanvas *_canvas);
		WordWrapTextBox(string _initText, int _x, int _y, int _colsize, int _rowsize, DrawingCanvas *_canvas);
		
		void updateText();
		void scrollUp();
		void scrollDown();
		void scrollBottom();
		void scrollTop();
		
		void setText(string _text);
		string getText();
};

#endif /*WORDWRAPTEXTBOX_H_*/
